<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>首页</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta name="description" content=""/>
    <meta name="author" content=""/>
    <link rel="stylesheet" type="text/css" href="${request.getContextPath()}/css/prompt/Lobibox.min.css" />
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<style type="text/css">
		body{
			background-color: #e7e7e7;
		}
		.main{
			padding: 20px;
		}
		.panel {
			background-color: #FFF;
			box-shadow: 0px 2px 4px #ccc;
			margin-bottom: 20px;
			border: 1px solid transparent;
			border-radius: 4px;
		}
		.panel_title {
			position: relative;
			height: 45px;
			padding: 0 15px;
			border-bottom: #d9dadc solid 1px;
		}
		.panel_main {
			padding: 50px;
		}
		.panel_li_3 {
			width: 33.33333333%;
			float: left;
		}
		.panel_li_2 {
			width: 50%;
			float: left;
		}
		.panel_li_div {
			margin-bottom: 20px;
		}
		
		.report_div{
			position: absolute;
			right: 25px;
			top: -6px;
		}
		.report_div_1{
			position: absolute;
			right: 350px;
			top: -6px;
		}
		.report_btn {
			display: inline-block;
			background-color: #FFF;
			border: #d9dadc solid 1px;
			color: black;
			height: 28px;
			line-height: 28px;
			width: 100px;
			border-radius: 4px;
			text-align: center;
			text-decoration: none!important;
		}
		.clear{ clear:both}
		.panel_li_vertical {
			margin-top: 9%;
		}
		.panel_li_report_div{
			margin-top: 10px;
		}
	</style>
	<script type="text/javascript">
		var contextPath = '${request.getContextPath()}';
	</script>
</head>

<body>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
     <h2 class="page-header">
     	我的测试
     </h2>
  <div class="table-responsive">
	<div class="main">
        <div class="panel">
			<div class="panel_title">
				<h4>单元测试</h4>
				<div class="report_div">
					<a class="report_btn" onclick="report.index.getUnitReportPage();">查看报告</a>
				</div>
			</div>
			<div>
			<div class="row">
			  <div class="col-md-4"><div id="iweek" style="width:100%;height:300px;"></div></div>
			  <div class="col-md-4"><div id="isuccess" style="width:100%;height:300px;"></div></div>
			  <div class="col-md-4"><div id="aisuccess" style="width:100%;height:300px;"></div></div>
			</div>
				<div class="clear"></div> 
			</div>
		</div>
		
		<div class="panel">
			<div class="panel_title">
				<h4>接口测试</h4>
				<div class="report_div_1">
					项目  <select class="selectpicker" id="ucProjectType" style="height:25px;" >
						<option value="">请选择测试项目</option>
						<#if projects??>
							<#list projects as project>
								<option value="${project.projectId}">${project.projectName}</option>
							</#list>
						</#if>
					</select>
				</div>
				<div class="report_div">
					环境选择  <select class="selectpicker" id="ucEnvironmentType" style="height:25px;" >
						<option value="" id="">请选择测试环境</option>
					</select>
					<a class="report_btn" onclick="report.index.triggerKey();">一键快测</a>
				</div>
			</div>
			<div class="row">
		 	   <div class="project-list" style="padding-right: 15px;padding-left: 15px;">
		 	   		<div class="col-sm-3">
                        <div class="input-group">
                            <input type="text" placeholder="请输入关键词" class="input-sm form-control"> <span class="input-group-btn">
                        <button type="button" class="btn btn-sm btn-primary"> 搜索</button> </span>
                        </div>
                    </div>
                     <table class="table table-hover">
                     	<thead>
                             <tr>
                             	<th>测试状态</th>
                                 <th>环境</th>
                                 <th>时间</th>
                                 <th>测试结果</th>
                                 <th>操作</th>
                             </tr>
                         </thead>
                         <tbody id="jobBody">
                         	<#if jobsList??>
                         		<#list jobsList as list>
			                         <tr>
				                         <td class="project-status">
				                             <span class="label label-primary">当前状态：${list.jobStatus}</span>
				                         </td>
				                         <td class="project-status">
				                             <span class="label label-primary">应用工厂</span>
				                         </td>
				                         <td class="project-title">
				                             <small>创建于 ${list.createTime}</small>
				                         </td>
				                         <td class="project-status">
				                              <small id="uresult">当前结果： ${list.jobDesc}</small>
				                         </td>
				                         <td class="project-actions">
				                             <a href="#" class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看 </a>
				                         </td>
			                     	</tr>
	                     		</#list>
	                     	</#if>
                    </tbody>
                 </table>
                <!--  <div class="ibox-content">
                 	<table class="table table-striped">
                         <thead>
                             <tr>
                                 <th>环境</th>
                                 <th>时间</th>
                                 <th>测试状态</th>
                                 <th>测试结果</th>
                                 <th>操作</th>
                             </tr>
                         </thead>
                         <tbody>
                             <tr id="ucProductEnviro">
                                 <td>1</td>
                                 <td><span class="line" style="display: none;">5,3,2,-1,-3,-2,2,3,5,2</span><svg class="peity" height="16" width="32"><polygon fill="#1ab394" points="0 9.375 0 0.5 3.5555555555555554 4.25 7.111111111111111 6.125 10.666666666666666 11.75 14.222222222222221 15.5 17.77777777777778 13.625 21.333333333333332 6.125 24.888888888888886 4.25 28.444444444444443 0.5 32 6.125 32 9.375"></polygon><polyline fill="transparent" points="0 0.5 3.5555555555555554 4.25 7.111111111111111 6.125 10.666666666666666 11.75 14.222222222222221 15.5 17.77777777777778 13.625 21.333333333333332 6.125 24.888888888888886 4.25 28.444444444444443 0.5 32 6.125" stroke="#169c81" stroke-width="1" stroke-linecap="square"></polyline></svg>
                                 </td>
                                 <td>张三</td>
                                 <td class="text-navy"> <i class="fa fa-level-up"></i> 40%</td>
                                 <td>张三</td>
                             </tr>
                             <tr id="ucPreProductEnviro">
                                 <td>2</td>
                                 <td><span class="line" style="display: none;">5,3,9,6,5,9,7,3,5,2</span><svg class="peity" height="16" width="32"><polygon fill="#1ab394" points="0 15 0 7.166666666666666 3.5555555555555554 10.5 7.111111111111111 0.5 10.666666666666666 5.5 14.222222222222221 7.166666666666666 17.77777777777778 0.5 21.333333333333332 3.833333333333332 24.888888888888886 10.5 28.444444444444443 7.166666666666666 32 12.166666666666666 32 15"></polygon><polyline fill="transparent" points="0 7.166666666666666 3.5555555555555554 10.5 7.111111111111111 0.5 10.666666666666666 5.5 14.222222222222221 7.166666666666666 17.77777777777778 0.5 21.333333333333332 3.833333333333332 24.888888888888886 10.5 28.444444444444443 7.166666666666666 32 12.166666666666666" stroke="#169c81" stroke-width="1" stroke-linecap="square"></polyline></svg>
                                 </td>
                                 <td>李四</td>
                                 <td class="text-warning"> <i class="fa fa-level-down"></i> -20%</td>
                                 <td>张三</td>
                             </tr>
                             <tr id="ucTestEnviro">
                                 <td>3</td>
                                 <td><span class="line" style="display: none;">1,6,3,9,5,9,5,3,9,6,4</span><svg class="peity" height="16" width="32"><polygon fill="#1ab394" points="0 15 0 13.833333333333334 3.2 5.5 6.4 10.5 9.600000000000001 0.5 12.8 7.166666666666666 16 0.5 19.200000000000003 7.166666666666666 22.400000000000002 10.5 25.6 0.5 28.8 5.5 32 8.833333333333332 32 15"></polygon><polyline fill="transparent" points="0 13.833333333333334 3.2 5.5 6.4 10.5 9.600000000000001 0.5 12.8 7.166666666666666 16 0.5 19.200000000000003 7.166666666666666 22.400000000000002 10.5 25.6 0.5 28.8 5.5 32 8.833333333333332" stroke="#169c81" stroke-width="1" stroke-linecap="square"></polyline></svg>
                                 </td>
                                 <td>王麻子</td>
                                 <td class="text-navy"> <i class="fa fa-level-up"></i> 26%</td>
                                 <td>张三</td>
                             </tr>
                             <tr id="ucVisualEnviro">
                                 <td>3</td>
                                 <td><span class="line" style="display: none;">1,6,3,9,5,9,5,3,9,6,4</span><svg class="peity" height="16" width="32"><polygon fill="#1ab394" points="0 15 0 13.833333333333334 3.2 5.5 6.4 10.5 9.600000000000001 0.5 12.8 7.166666666666666 16 0.5 19.200000000000003 7.166666666666666 22.400000000000002 10.5 25.6 0.5 28.8 5.5 32 8.833333333333332 32 15"></polygon><polyline fill="transparent" points="0 13.833333333333334 3.2 5.5 6.4 10.5 9.600000000000001 0.5 12.8 7.166666666666666 16 0.5 19.200000000000003 7.166666666666666 22.400000000000002 10.5 25.6 0.5 28.8 5.5 32 8.833333333333332" stroke="#169c81" stroke-width="1" stroke-linecap="square"></polyline></svg>
                                 </td>
                                 <td>王麻子</td>
                                 <td class="text-navy"> <i class="fa fa-level-up"></i> 26%</td>
                                 <td>张三</td>
                             </tr>
                             <tr id="ucAwsEnviro">
                                 <td>3</td>
                                 <td><span class="line" style="display: none;">1,6,3,9,5,9,5,3,9,6,4</span><svg class="peity" height="16" width="32"><polygon fill="#1ab394" points="0 15 0 13.833333333333334 3.2 5.5 6.4 10.5 9.600000000000001 0.5 12.8 7.166666666666666 16 0.5 19.200000000000003 7.166666666666666 22.400000000000002 10.5 25.6 0.5 28.8 5.5 32 8.833333333333332 32 15"></polygon><polyline fill="transparent" points="0 13.833333333333334 3.2 5.5 6.4 10.5 9.600000000000001 0.5 12.8 7.166666666666666 16 0.5 19.200000000000003 7.166666666666666 22.400000000000002 10.5 25.6 0.5 28.8 5.5 32 8.833333333333332" stroke="#169c81" stroke-width="1" stroke-linecap="square"></polyline></svg>
                                 </td>
                                 <td>王麻子</td>
                                 <td class="text-navy"> <i class="fa fa-level-up"></i> 26%</td>
                                 <td>张三</td>
                             </tr>
                         </tbody>
                     </table>
                 </div> -->
              </div>
			  <div class="col-md-4"><div id="uweek" style="width:100%;height:300px;"></div></div>
			  <div class="col-md-4"><div id="usuccess" style="width:100%;height:300px;"></div></div>
			  <div class="col-md-4"><div id="uisuccess" style="width:100%;height:300px;"></div></div>
			</div> 
			<!-- <div >
				<div class="panel_li_2">
					为ECharts准备一个具备大小（宽高）的Dom
    				<div id="main"></div>	
				</div>
				<div class="panel_li_2">
					<div class="panel_li_2">
						<div class="panel_li_div">测试专家：马静</div>
						<div class="panel_li_div">测试专家：马静</div>
						<div class="panel_li_div">测试专家：马静</div>
						<div class="panel_li_div">测试专家：马静</div>
					</div>
					<div class="panel_li_2">
						<div class="panel_li_vertical">
							<div>xxxxxxxxxxxxxBUGxxxx</div>
							<div class="panel_li_report_div">
								<a class="report_btn">查看报告</a>
							</div>
						</div>
					</div>
					<div class="clear"></div> 
				</div>
				<div class="clear"></div> 
			</div> -->
		</div>
    </div>
 </div>
 </div>
</body>
	<script type="text/javascript" src="${request.getContextPath()}/js/common/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="${request.getContextPath()}/js/prompt/lobibox.min.js"></script>
 	<script type="text/javascript" src="${request.getContextPath()}/js/report/echarts.min.js"></script>
	<script type="text/javascript" src="${request.getContextPath()}/js/common/echarts.js"></script>
	<script type="text/javascript" src="${request.getContextPath()}/js/common/common.js"></script>
	<script type="text/javascript" src="${request.getContextPath()}/js/main/report.js"></script>
	<script type="text/javascript">
		$("#ucProjectType").bind("click",function(){
			var projectId = $("#ucProjectType").find("option:selected").val();
			if(projectId!=null&&projectId!=""){
				var params = {
						"projectId":projectId
					};
					var path = contextPath+"/report/getProjectEnvironment";
					$.ajax({
						type:"POST",
						url:path,
						contentType:"application/json; charset=utf-8",
						data:JSON.stringify(params),
						dataType:"json",
						async:false,
						success: function (response) {
							if(response&&response.code==0){
								var result = response.result;
								var options = "<option value=''>请选择测试环境</option>";
								$.each(result.environments,function(index,environment){
									options = options+"<option value='"+environment.environmentId+"' id='"+environment.environmentUrl+"' name='"+environment.environmentName+"'>"+environment.environmentName+"</option>";
								});
								$("#ucEnvironmentType").html("");
								$("#ucEnvironmentType").html(options);
							}else{
								Lobibox.alert('error', {
				                    msg: "查询测试环境失败"
				                });
							}
						},error:function(response){
							Lobibox.alert('error', {
			                    msg: "删除测试环境异常"
			                });
					    }
					});
			}
		});
	</script>
</html>